package cn.kgc.spring02.entity;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 * @Author: 课工场
 * @Version: v1.0  2023/2/17
 * @Description:   @Value 实现对象属性的初始化
 */
@Component
public class User {

    @Value("tom")
    private String username;
    @Value("1")
    private Integer id;

    @Override
    public String toString() {
        return "User{" +
                "username='" + username + '\'' +
                ", id=" + id +
                '}';
    }
}
